<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Streams a MP3 file</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="swfmovie.stopsound.html">SWFMovie::stopSound</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="swfmovie.writeexports.html">SWFMovie::writeExports</a></div>
 <div class="up"><a href="class.swfmovie.html">SWFMovie</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="swfmovie.streammp3" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">SWFMovie::streamMP3</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.3.3)</p><p class="refpurpose"><span class="refname">SWFMovie::streamMP3</span> &mdash; <span class="dc-title">Streams a MP3 file</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-swfmovie.streammp3-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">int</span> <span class="methodname"><strong>SWFMovie::streamMP3</strong></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$mp3file</code></span>
   [, <span class="methodparam"><span class="type">float</span> <code class="parameter">$skip</code><span class="initializer"> = 0</span></span>
  ] )</div>

  <div class="warning"><strong class="warning">Warning</strong><p class="simpara">此函数是<em class="emphasis">实验性</em>的。此函数的表象，包括名称及其相关文档都可能在未来的
PHP 发布版本中未通知就被修改。使用本函数风险自担 。</p></div>
  <p class="para">
   Streams the given MP3 file <em><code class="parameter">mp3file</code></em>.
  </p>
  <p class="para">
   This method is not very robust in dealing with oddities (can skip over an
   initial ID3 tag, but that&#039;s about it). 
  </p>
  <p class="para">
   Note that the movie isn&#039;t smart enough to put enough frames in to contain 
   the entire mp3 stream- you&#039;ll have to add (length of song * frames per second)
   frames to get the entire stream in. 
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-swfmovie.streammp3-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">mp3file</code></em></dt>

     <dd>

      <p class="para">
       Can be a file pointer returned by <span class="function"><a href="function.fopen.html" class="function">fopen()</a></span> or the 
       MP3 data, as a binary string.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">skip</code></em></dt>

     <dd>

      <p class="para">
       Number of seconds to skip.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 
 <div class="refsect1 returnvalues" id="refsect1-swfmovie.streammp3-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Return number of frames.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-swfmovie.streammp3-changelog">
  <h3 class="title">更新日志</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>版本</th>
       <th>说明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>5.2.0</td>
       <td><em><code class="parameter">skip</code></em> added</td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-swfmovie.streammp3-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-3458">
    <p><strong>Example #1 Streaming example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$m&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">SWFMovie</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$m</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setRate</span><span style="color: #007700">(</span><span style="color: #0000BB">12.0</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$m</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">streamMp3</span><span style="color: #007700">(</span><span style="color: #0000BB">file_get_contents</span><span style="color: #007700">(</span><span style="color: #DD0000">"distortobass.mp3"</span><span style="color: #007700">));<br /></span><span style="color: #FF8000">//&nbsp;use&nbsp;your&nbsp;own&nbsp;MP3<br /><br />//&nbsp;The&nbsp;file&nbsp;is&nbsp;11.85&nbsp;seconds&nbsp;at&nbsp;12.0&nbsp;fps&nbsp;=&nbsp;142&nbsp;frames<br /></span><span style="color: #0000BB">$m</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setFrames</span><span style="color: #007700">(</span><span style="color: #0000BB">142</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-type:&nbsp;application/x-shockwave-flash'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$m</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">output</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="swfmovie.stopsound.html">SWFMovie::stopSound</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="swfmovie.writeexports.html">SWFMovie::writeExports</a></div>
 <div class="up"><a href="class.swfmovie.html">SWFMovie</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
